#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int majorityElement(int* nums, int numsSize)
{
    int i = 0;
    int key = 0;
    for (i = 0; i < numsSize; i++)
    {
        int j = 0;
        for (j = 0; j < numsSize; j++)
        {
            if (nums[j] == nums[i])
                key++;
        }
        if (key > numsSize / 2)
            return (nums[i]);
    }
}
int main()
{
    char arr[100] = { 0 };
    scanf("%s", arr);

    int i = 0;
    int sz = strlen(arr);
    for (i = 0; i < sz-1; i++)
    {
        int j = 0;
        for (j = 0; j < sz - i - 1; j++)
        {
            if (arr[j] > arr[j + 1])
            {
                char tmp = arr[j + 1];
                arr[j + 1] = arr[j];
                arr[j] = tmp;
            }
        }
    }
    printf("%s", arr);
    int arr[6] = { 2,2,1,1,2,2 };
    printf("%d", majorityElement(arr,6));



    return 0;
}